﻿// Study0704.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
// 第七章 继承 派生类的继承

#include <iostream>
using namespace std;

class Base1
{
public:
	Base1(int i)
	{
		cout << "调用Base1的构造函数 " << i << endl;
	}
	~Base1()
	{
		cout << "调用Base1的析构函数 " << endl;
	}
};
class Base2
{
public:
	Base2(int j)
	{
		cout << "调用Base2的构造函数 " << j << endl;
	}
	~Base2()
	{
		cout << "调用Base2的析构函数 " << endl;
	}
};
class Base3
{
public:
	Base3()
	{
		cout << "调用Base3的构造函数 *" << endl;
	}
	~Base3()
	{
		cout << "调用Base3的析构函数 " << endl;
	}
};

class Derived:public Base2,public Base1,public Base3
{
public:
	Derived(int a,int b,int c,int d):Base2(a),Base1(b),num1(c),num2(d){}
private:
	Base1 num1;
	Base2 num2;
	Base3 num3;
};
int main()
{
	Derived obj{ 1,2,3,4 };
	return 0;
}


